package exampleone;

import interactions.CollisionInteraction;
import interactions.Interaction;
import java.io.File;
import java.util.ArrayList;
import sprite.Sprite;
import updater.InteractionUpdater;
import updater.SpriteUpdater;
import updater.WinLossStateUpdater;
import factory.InteractionFactory;
import factory.SpriteFactory;
import gamehandlers.GameHandler;
import gui.GameFrame;


/**
 * @author Yaqi Zhang
 * 
 */
public class RunGame1 {
    private RunGame1 () {
        GameHandler gameHandler = new GameHandler();
        SpriteFactory spriteFactory = new SpriteFactory();
        InteractionFactory interactionFactory = new InteractionFactory();
        ArrayList<Sprite> spritesList = (ArrayList<Sprite>) spriteFactory
                .getSprites(new File("resources/SpriteLevel1"), gameHandler);
        gameHandler.setMySpriteList(spritesList);
        Interaction colliInteract = new CollisionInteraction();
        interactionFactory.setReactionMap(colliInteract, new File(
                "resources/testLevel1"), gameHandler);
        InteractionUpdater iUpdater = new InteractionUpdater(spritesList);
        iUpdater.addInteraction(colliInteract);
        SpriteUpdater sUpdater = new SpriteUpdater(spritesList, gameHandler);
        // WinLossStateUpdater wlsUpdater = new WinLossStateUpdater();
        gameHandler.addUpdater(iUpdater);
        gameHandler.addUpdater(sUpdater);
        GameFrame frame = new GameFrame("Example Game 1", "English", 1,
                gameHandler);
        gameHandler.setFrame(frame);
    }

    public static void main (String[] args) {
        new RunGame1();
    }
}
